package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcTeachSchedual;
import com.visizen.wisdomclass.server.model.WcTeachSchedualExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcTeachSchedualMapper {
    @SelectProvider(type=WcTeachSchedualSqlProvider.class, method="countByExample")
    int countByExample(WcTeachSchedualExample example);

    @DeleteProvider(type=WcTeachSchedualSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcTeachSchedualExample example);

    @Delete({
        "delete from wc_teach_schedual",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long ID);

    @Insert({
        "insert into wc_teach_schedual (ID, USER_ID, ",
        "GROUP_ID, COURSE_ID, ",
        "STATE, BEGIN_TIME)",
        "values (#{ID,jdbcType=BIGINT}, #{USER_ID,jdbcType=BIGINT}, ",
        "#{GROUP_ID,jdbcType=BIGINT}, #{COURSE_ID,jdbcType=INTEGER}, ",
        "#{STATE,jdbcType=INTEGER}, #{BEGIN_TIME,jdbcType=TIMESTAMP})"
    })
    int insert(WcTeachSchedual record);

    @InsertProvider(type=WcTeachSchedualSqlProvider.class, method="insertSelective")
    int insertSelective(WcTeachSchedual record);

    @SelectProvider(type=WcTeachSchedualSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="GROUP_ID", property="GROUP_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="COURSE_ID", property="COURSE_ID", jdbcType=JdbcType.INTEGER),
        @Result(column="STATE", property="STATE", jdbcType=JdbcType.INTEGER),
        @Result(column="BEGIN_TIME", property="BEGIN_TIME", jdbcType=JdbcType.TIMESTAMP)
    })
    List<WcTeachSchedual> selectByExample(WcTeachSchedualExample example);

    @Select({
        "select",
        "ID, USER_ID, GROUP_ID, COURSE_ID, STATE, BEGIN_TIME",
        "from wc_teach_schedual",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="ID", property="ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="GROUP_ID", property="GROUP_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="COURSE_ID", property="COURSE_ID", jdbcType=JdbcType.INTEGER),
        @Result(column="STATE", property="STATE", jdbcType=JdbcType.INTEGER),
        @Result(column="BEGIN_TIME", property="BEGIN_TIME", jdbcType=JdbcType.TIMESTAMP)
    })
    WcTeachSchedual selectByPrimaryKey(Long ID);

    @UpdateProvider(type=WcTeachSchedualSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcTeachSchedual record, @Param("example") WcTeachSchedualExample example);

    @UpdateProvider(type=WcTeachSchedualSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcTeachSchedual record, @Param("example") WcTeachSchedualExample example);

    @UpdateProvider(type=WcTeachSchedualSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcTeachSchedual record);

    @Update({
        "update wc_teach_schedual",
        "set USER_ID = #{USER_ID,jdbcType=BIGINT},",
          "GROUP_ID = #{GROUP_ID,jdbcType=BIGINT},",
          "COURSE_ID = #{COURSE_ID,jdbcType=INTEGER},",
          "STATE = #{STATE,jdbcType=INTEGER},",
          "BEGIN_TIME = #{BEGIN_TIME,jdbcType=TIMESTAMP}",
        "where ID = #{ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcTeachSchedual record);
}